package com.oceanread.cn.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.oceanread.cn.entity.Pipeline;
import com.oceanread.cn.mapper.PipelineMapper;
import com.oceanread.cn.service.IPipelineService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IPipelineServiceImpl extends ServiceImpl<PipelineMapper, Pipeline> implements IPipelineService {
    public List<Pipeline> getall() {
        return baseMapper.getall();
    }

    public List<Pipeline> query(String key, String value) {
        return baseMapper.query(key, value);
    }
    public List<Pipeline> equal(String key, String value) {
        return baseMapper.equal(key, value);
    }
    public List<Pipeline> equal2(String key, String value,String key2, String value2) {
        return baseMapper.equal2(key, value,key2, value2);
    }
    public List<Pipeline> query1(String key, String value, int page, int size) {
        return baseMapper.query1((page - 1) * size, size, key, value);
    }


    public int insert(String PrjCode, String Name, String Type, String IDLine, String IDPoint,
                      String North, String East, String Lat, String Lon, String Distance,
                      String DisZ, String Angle, String Note, String Line, Integer pointOrder, String length, String depth) {
        return baseMapper.insert(PrjCode, Name, Type, IDLine, IDPoint,
                North, East, Lat, Lon, Distance,
                DisZ, Angle, Note, Line, pointOrder, length, depth);
    }

    @Override
    public Integer update(Pipeline pipeline) {
        return baseMapper.update(pipeline.getSYSID(), pipeline.getPrjCode(), pipeline.getName(), pipeline.getType(),
                pipeline.getIDLine(), pipeline.getIDPoint(), pipeline.getNorth(), pipeline.getEast(), pipeline.getLat(),
                pipeline.getLon(), pipeline.getDistance(), pipeline.getDisZ(), pipeline.getAngle(), pipeline.getNote(),
                pipeline.getLine(),pipeline.getPointOrder() ,pipeline.getLength(),pipeline.getDepth());
    }

    public Integer delete(int id) {
        return baseMapper.delete(id);
    }

    @Override
    public Integer getnum() {
        return baseMapper.getnum();
    }

    @Override
    public Integer getnumquery(String key, String value) {
        return baseMapper.getnumquery(key, value);
    }

    @Override
    public List<Pipeline> findall(int page, int size) {
        return baseMapper.findall((page - 1) * size, size);
    }

    @Override
    public List<Pipeline> getLine(String PrjCode) {
        return baseMapper.getLine(PrjCode);
    }

    @Override
    public List<Pipeline> getPoint(String PrjCode, String IDLine) {
        return baseMapper.getPoint(PrjCode, IDLine);
    }

    @Override
    public List<Pipeline> getLine_Page(String PrjCode, int page, int size) {
        return baseMapper.getLine_Page(PrjCode, (page - 1) * size, size);
    }
    @Override
    public Integer getLine_Num(String PrjCode) {
        return baseMapper.getLine_Num(PrjCode);
    }
    @Override
    public List<Pipeline> getPoint_Page(String PrjCode, String IDLine, int page, int size) {
        return baseMapper.getPoint_Page(PrjCode, IDLine,(page - 1) * size, size);
    }
    @Override
    public Integer getPoint_Num(String PrjCode,String IDLine) {
        return baseMapper.getPoint_Num(PrjCode, IDLine);
    }

}
